<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="renderer" content="webkit">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>pFinalJS</title>

    <!--jQuery-->
    <script src="../jquery/jquery.min.js"></script>

    <!--bootstrap-->
    <link href="../bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <script src="../bootstrap/js/bootstrap.min.js"></script>

    <!--依赖 popup -->
    <link rel="stylesheet" href="../popup/popup.css"/>
    <script src="../popup/popup.min.js"></script>

    <!--RainJS-->
    <script src="pfinal-mobile.js"></script>

    <link href="css/base.css" rel="stylesheet"/>

</head>
<body>

<div id="show-test" style="display: none">
    <a href="javascript:window.show.close();">Close</a>

    <div>aaaa</div>
</div>

<div style="margin: 20px;">

    <button class="btn btn-primary js-loading1">loading1</button>

    <button class="btn btn-primary js-loading2" data-loading-text="正在加载...">loading2</button>

    <div class="btn btn-primary js-alert">alert</div>

    <div class="btn btn-primary js-confirm">confirm</div>

    <div class="btn btn-primary js-cute">toast</div>

    <div class="btn btn-primary js-show-div">showDiv</div>
</div>

<script>
    $(".js-loading1").click(function () {
        var loading = pFinal.loading().start();
        setTimeout(function () {
            loading.stop();
        }, 2000);
    });

    $(".js-loading2").click(function () {
        var loading = pFinal.loading(this).start();
        setTimeout(function () {
            loading.stop();
        }, 2000);
    });

    $(".js-alert").click(function () {
        pFinal.alert("测试", function () {
            alert(11);
        });
    });


    $(".js-confirm").click(function () {
        pFinal.confirm("测试", function () {
            alert(1)
        }, function () {
            alert(2)
        });
    });

    $(".js-cute").click(function () {

        pFinal.toast("操作成功", function () {
            alert('已自动关闭')
        });
    });
    $(".js-show-div").click(function () {

        window.show = pFinal.show("#show-test", function () {
            alert("close");
        });
    });
</script>
</body>
</html>